To get this version, you can use the apt package manager. Refresh your local package index by typing:
apt update
Install Node.js from the repositories:
apt install nodejs
apt install npm
cd ~
apt install curl
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
Run the script
bash nodesource_setup.sh
apt install nodejs
node -v
npm -v
latest version~~
visit github page nvm and you can get command line
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
run the script
bash install_nvm.sh
It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to use the file.
To gain access to the nvm functionality, you'll need to either log out and log back in again or source the ~/.profile file so that your current session knows about the changes:
source ~/.profile
list nvm version
nvm ls-remote
nvm alias default 8.11.1
nvm use default
apt update
apt install git
git --version
cd /var/miaoli
npm install
npm start